package com.ruoyi.system.domain;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.Domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
@TableName("t_bank")
@Accessors(chain = true)
public class Bank extends Domain {
    @TableId(value = "id", type = IdType.AUTO)//如果没有这句 id会以很大的id
    @ApiModelProperty(name = "id", value = "主键-ID")
    private Long id;
    @ApiModelProperty(value = "银行名称")

    private String channelCode;
    @ApiModelProperty(value = "银行名称")

    private String channelName;
    @ApiModelProperty(value = "银行名称")
    //@NotBlank(message = "银行名称不能为空")
    private String bankName;
    @ApiModelProperty(value = "姓名")
    //@NotBlank(message = "姓名不能为空")
    private String name;
    @ApiModelProperty(value = "银行账号  微信收款码  支付宝收款码")
    @NotBlank(message = "账号不能为空")
    private String cardNo;
    @ApiModelProperty(value = "账号/手机号")
    private String username  ;
    @ApiModelProperty(value = "用户id")
    private Long userId;
    @ApiModelProperty(value = "用户id")
    private String zfbUserId;
   // @NotBlank(message = "zfb   bank")
    private String type;
    @ApiModelProperty(value = "支付宝用户Url")
    private String zfbUrl;

    @ApiModelProperty(value = "1 启用  0 禁用")
    private Integer status;
    @ApiModelProperty(value = "最大收款金额")
    private BigDecimal maxAmount;

    public static void main(String[] args) {
        String s1 = StrUtil.subBefore("www.baidu.com/adfadf/1.jpg?sign?abc", "?", false);


        String s2= StrUtil.subBefore("www.baidu.com/adfadf/1.jpg?sign?abc", "?", true);


        System.out.println(s1);
        System.out.println(s2);
    }

}
